package com.drought.rained.presenter;

import com.drought.rained.BuildConfig;
import com.drought.rained.business.CustomConsumerLJ;
import com.drought.rained.business.ParamsFactoryLJ;
import com.drought.rained.cache.UserInfoLJ;
import com.drought.rained.mvpview.RolloverAppMvpVipwLJ;
import com.drought.rained.response.BlankResponseLJ;

import io.reactivex.functions.Consumer;

public class RolloverAppPresenterLJ extends BasePresenterLJ {
    private RolloverAppMvpVipwLJ mvpView;

    public RolloverAppPresenterLJ(RolloverAppMvpVipwLJ mvpView) {
        this.mvpView = mvpView;
    }

    public void checkCollectStatus() {
        toSubScribe(req.checkCollectStatus(BuildConfig.channel, UserInfoLJ.getToken(), ParamsFactoryLJ.getCommonParams(null)), new CustomConsumerLJ<BlankResponseLJ>() {
            @Override
            public void call(BlankResponseLJ updateResponse) {
                mvpView.onGetDataNext(updateResponse);
            }
        }, new Consumer<Throwable>() {
            @Override
            public void accept(Throwable throwable) throws Exception {
                mvpView.onGetDataError(throwable);
            }
        });
    }

}
